package com.lcb.dubbo;

import com.lcb.client.User;
import com.lcb.client.UserService;
import org.apache.dubbo.config.annotation.Reference;
import org.apache.dubbo.config.spring.context.annotation.EnableDubbo;
import org.springframework.boot.ApplicationRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

@EnableDubbo
@SpringBootApplication
public class SpringbootClientApplication {

    @Reference
    private UserService userService;

    public static void main(String[] args) {
        SpringApplication.run(SpringbootClientApplication.class, args);
    }

    @Bean
    public ApplicationRunner getBean() {

        return args -> {
            User user = userService.getUser(1);
            System.out.println(user);
        };
    }

}
